package collections.g3;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;


public class ListDemo {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		List<Integer> intList = 
				new ArrayList<Integer>();
		
		intList.add(1);
		intList.add(2);
		intList.add(4);
		intList.add(8);
		intList.add(16);
		
		
		for(Integer i : intList){
			System.out.println(i);
		}
		
		intList.remove(new Integer(4));
		System.out.println("------------");
		
		Iterator<Integer> iter = intList.iterator();
		while(iter.hasNext()){
			System.out.println(iter.next());
			
		}
	}

}
